Overlapping and Order-Independent Patterns - Definitional Equality for All

نویسندگان

  • Jesper Cockx
  • Frank Piessens
  • Dominique Devriese
چکیده

Dependent pattern matching is a safe and efficient way to write programs and proofs in dependently typed languages. Current languages with dependent pattern matching treat overlapping patterns on a first-match basis, hence the order of the patterns can matter. Perhaps surprisingly, this order-dependence can even occur when the patterns do not overlap. To fix this confusing behavior, we developed a new semantics of pattern matching which treats all clauses as definitional equalities, even when the patterns overlap. A confluence check guarantees correctness in the presence of overlapping patterns. Our new semantics has two advantages. Firstly, it removes the order-dependence and thus makes the meaning of definitions clearer. Secondly, it allows the extension of existing definitions with new (consistent) evaluation rules. Unfortunately it also makes pattern matching harder to understand theoretically, but we give a theorem that helps to bridge this gap. An experimental implementation in Agda shows that our approach is feasible in practice too.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Word Definitional Skills in School age Persian Speaking Children: A Developmental Study on Form

Objectives: Word definitional skills (WDSs) were classified according to the quality of both semantic content and syntactic form. The aim of the present study was to investigate the syntactic development in WDSs in typically developing school- age children. Methods: In this cross-sectional and descriptive-analytical study,  150 of typically developing school-age children participated by...

متن کامل

A Higher-Order Demand-Driven Narrowing Calculus with Definitional Trees

We generalize the Constructor-based ReWriting Logic CRWL to the setting of the simply typed λ-calculus, where theories are presented by conditional overlapping fully extended pattern rewrite systems. We claim that this logic is useful for higher-order functional-logic programming, and propose a Higher-Order Lazy Narrowing calculus HOLNDT for answering joinability and reducibility queries, in wh...

متن کامل

Comparing the overlapping of two independent confidence intervals with a single confidence interval for two normal population parameters

Two overlapping confidence intervals have been used in the past to conduct statistical inferences about two population means and proportions. Several authors have examined the shortcomings of Overlap procedure and have determined that such a method distorts the significance level of testing the null hypothesis of two population means and reduces the statistical power of the test. Nearly all res...

متن کامل

A Simplified Account of the Metatheory of Linear LF

We present a variant of the linear logical framework LLF that avoids the restriction that well-typed forms be in pre-canonical form and adds λ-abstraction at the level of families. We abandon the use of β-conversion as definitional equality in favor of a set of typed definitional equality judgments that include rules for parallel conversion and extensionality. We show type-checking is decidable...

متن کامل

Reasoning Inside The Box: Deduction in Herbrand Logics

Herbrand structures are a subclass of standard first-order structures commonly used in logic and automated reasoning due to their strong definitional character. This paper is devoted to the logics induced by them: Herbrand and semi-Herbrand logics, with and without equality. The rich expressiveness of these logics entails that there is no adequate effective proof system for them. We therefore i...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014